import http from './fetch.js';

/**
 * 分类列表
 */
export function categoryList() {
  return http({
    url: '/web/client/equipment/getTypeList',
    method: 'get'
  });
}

/**
 * 获取设备列表
 * @param params
 */
export function deviceList(params = {}) {
  return http({
    url: '/web/client/equipment/list',
    method: 'get',
    params: params
  });
}

/**
 * 设备详情
 * @param params
 */
export function deviceDetail(params = {}) {
  return http({
    url: '/web/client/equipment/getDetail',
    method: 'get',
    params: params
  });
}


/**
 * 创建订单
 * @param params
 */
export function createLeaseOrder(params = {}) {
  return http({
    url: '/web/client/equipment/createOrderV2',
    method: 'get',
    params: params
  });
}

/**
 * 订单列表
 * @param params
 */
export function leaseOrderList(params = {}) {
  return http({
    url: '/web/client/equipment/orderList',
    method: 'get',
    params: params
  });
}

/**
 * 支付订单
 * @param params
 */
export function leaseOrderPay(params = {}) {
  return http({
    url: '/web/client/equipment/payForOrder',
    method: 'get',
    params: params
  });
}

/**
 * 支付状态获取
 * @param params
 */
export function leaseOrderStatus(params = {}) {
  return http({
    url: '/web/client/equipmentPayStatus',
    method: 'get',
    params: params
  });
}

/**
 * 获取最新订单
 * @param params
 */
export function getFirstOrder(params = {}) {
  return http({
    url: '/web/client/equipment/getFirstOrder',
    method: 'get',
    params: params
  });
}

/**
 * 修改订单状态
 * @param params
 */
export function leaseOrderChange(params = {}) {
  return http({
    url: '/web/client/equipment/settleOrder',
    method: 'post',
    params: params
  });
}
